home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / go / prog / diagram.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1993-06-20  |  18.3 KB  |  877 lines

  1. #! /bin/sh
  2. # This is a shell archive, meaning:
  3. # 1. Remove everything above the #! /bin/sh line.
  4. # 2. Save the resulting text in a file.
  5. # 3. Execute the file with /bin/sh (not csh) to create:
  6. #    Makefile
  7. #    README
  8. #    go2latex.y
  9. #    go2ps.y
  10. #    gopro.ps
  11. #    input.l
  12. #    main.c
  13. #    printps
  14. #    sample.input
  15. # This archive created: Sat Jan 12 22:40:12 1991
  16. export PATH; PATH=/bin:/usr/bin:$PATH
  17. if test -f 'Makefile'
  18. then
  19.     echo shar: "will not over-write existing file 'Makefile'"
  20. else
  21. cat << \SHAR_EOF > 'Makefile'
  22. SHELL=/bin/sh
  23. BIN= /usr/esh/bin
  24. CFLAGS= -DLEXDEBUG -DYYDEBUG
  25. OFILES= lex.yy.o y.tab.o main.o
  26.  
  27. go2latex: $(OFILES)
  28.     cc $(OFILES) -o go2latex -ll
  29.  
  30. y.tab.h y.tab.c: go2latex.y
  31.     yacc -d go2latex.y
  32.  
  33. $(OFILES): y.tab.h yy.lex.c Makefile
  34.  
  35. yy.lex.c:  input.l
  36.     lex input.l
  37. SHAR_EOF
  38. fi
  39. if test -f 'README'
  40. then
  41.     echo shar: "will not over-write existing file 'README'"
  42. else
  43. cat << \SHAR_EOF > 'README'
  44. >From: Sean Hayes <esh@hplb.hpl.hp.com>
  45.  
  46. Please find enclosed some stuff for generating latex documents
  47. from Greg Hale's board postings. (NB this uses the ascii part and not the
  48. Smart Go stuff, which has to be removed). I was hoping to be able to
  49. spend more effort on  making this a little slicker, but I haven't had time.
  50. This is offered totally free, no acknowledments required, but
  51. I would like to hear if anybody improves on it.
  52.  
  53. --- 
  54. Later:
  55.  
  56. I still think the best approach is to make these text boards one
  57. of the input formats for convert. But in any case, what I have done
  58. is to used Jan van der Steen's postscript code as the setup file.
  59. This allows (at least) two types of stone printing:
  60.  
  61. (n) x y wst         % this prints a white stone labelled with n (this must
  62.                     % be an integer), offset from *the middle of the board*
  63.                     % by x and y (the lower left quadrant is +ve x +ve y)
  64.  
  65. x y ws              % this prints an unlabbelled  white stone
  66.                     % also offset from the middle of the board
  67.                     % by x and y
  68.  
  69. And there are the corresponding bst and bs functions. The code attatched
  70. at the bottom will generate postscript diagrams from the text parse (its
  71. really easy!).
  72.  Current deficiencies,
  73.       1 if you put characters on the board then it generates a call
  74.         to the non-existent label function. this should put a character
  75.         on the board in the right place (as you often find in the books).
  76.       2 it assumes numbers are alternating turns, beginning with black.
  77.         It would be better to add some key in the board to say who plays
  78.         first. (or maybe use +n for black -n for white?)
  79.  
  80. And I'm sure you can think of many more. Why don't you have a play
  81. with it and make any alterations you think fit. If you intend to use
  82. this and/or distribute it you ought to get in touch with Jan, as we
  83. are using code he asks to obtain written permission for.
  84. I am happy to keep discussing this, but I really must do some work now!
  85.            Enjoy,
  86.               Sean.
  87.  
  88.  
  89. Change 'go2latex' into 'go2ps' to get the postscript code.
  90.  
  91.  
  92. A sample input file is included.
  93.  
  94. SHAR_EOF
  95. fi
  96. if test -f 'go2latex.y'
  97. then
  98.     echo shar: "will not over-write existing file 'go2latex.y'"
  99. else
  100. cat << \SHAR_EOF > 'go2latex.y'
  101.  
  102. %{
  103.  
  104. /* YACC grammar for the Postings on rec.games.go by Greg Hale.
  105.  *              Sean Hayes .    August 9 1983
  106.  */
  107.  
  108. #include <stdio.h>
  109. #define YYDEBUG 1
  110. extern FILE *infp, *outfp;
  111. extern char * yytext;
  112. int i, j;
  113. char *index_chars = "abcdefghijklmnopqrst";
  114.  
  115. yyerror(s)
  116. char * s;
  117. { printf(" SYNTAX ERROR - The old yacc standard!\n %s");
  118.   exit(-1);
  119. }
  120.  
  121. %}
  122.  
  123. %union {
  124.        int ival;
  125.        char sval[22];
  126.        }
  127.  
  128. %token <ival> NUMBER PLUS_DASH_PLUS
  129. %token <sval> MOVE CHAR
  130.  
  131. /* grammar symbols */
  132. %token BAR DOTS DOT WHITE BLACK HANDICAP_PT
  133. %%
  134.  start:         moves
  135.                       {
  136.                        printf("\\end{document}\n");
  137.                        }
  138.  
  139. moves:        moves words
  140.      |          moves position
  141.      |          /* */ {
  142.                        printf("\\documentstyle[11pt]{report}\n");
  143.                        printf("\\begin{document}\n");
  144.                       }
  145.      ;
  146.  
  147. position:    PLUS_DASH_PLUS
  148.             { printf("\n\\begin{tabular}{r|");
  149.               for(j = 0, i = $1 - 5; i > 0; i-=2) putc('c',stdout);
  150.               printf("|l}\n\\ & ");
  151.               for(i = $1 - 5; i > 0; i-=2)
  152.                              printf("%c & ", index_chars[j++]);
  153.                           printf("\\  \\\\\n\\hline",$1);
  154.             }
  155.         lines PLUS_DASH_PLUS
  156.             { printf("\\hline\n\\end{tabular}\n\\\\\n\\\\\n");
  157.             }
  158.  
  159.     ;
  160.  
  161. lines:        NUMBER { printf(" %d ", $1); } BAR points BAR NUMBER
  162.                        { printf(" & %d \\\\\n", $6); } lines
  163.      |        BAR DOTS lines
  164.      |        /* empty */
  165.      ;
  166.  
  167. points:        points point
  168.       |        point
  169.       ;
  170.  
  171. point:        DOT
  172.                      { printf(" & $\\cdot$"); }
  173.       |        WHITE
  174.                      { printf(" & {\\Huge $\\circ$}"); }
  175.       |        BLACK
  176.                      { printf(" & {\\Huge $\\bullet$}"); }
  177.       |        MOVE
  178.                      { printf(" & {\\small $%c$}", $1[0]); }
  179.       |        HANDICAP_PT
  180.                      { printf(" & {\\tiny $\\bullet$}"); }
  181.       |         NUMBER
  182.              { printf(" & {\\small $%d$} ", $1); }
  183.       ;
  184.  
  185. words:        words CHAR
  186.                     { printf("%c",$2[0]); }
  187.      |          /* */
  188.      ;
  189.  
  190.  
  191. SHAR_EOF
  192. fi
  193. if test -f 'go2ps.y'
  194. then
  195.     echo shar: "will not over-write existing file 'go2ps.y'"
  196. else
  197. cat << \SHAR_EOF > 'go2ps.y'
  198.  
  199. %{
  200.  
  201. /* YACC grammar for the Postings on rec.games.go by Greg Hale.
  202.  * This one generates postscript.
  203.  *              Sean Hayes .    August 9 1983
  204.  */
  205.  
  206. #include <stdio.h>
  207. #define YYDEBUG 1
  208. #define BoardSize 19
  209. #define BLACKMOVE  "bst"
  210. #define WHITEMOVE  "wst"
  211. extern FILE *infp, *outfp;
  212. extern char * yytext;
  213. int i, j;
  214. char *index_chars = "abcdefghijklmnopqrst";
  215.  
  216. typedef struct posn {
  217.      int row;
  218.      int col;
  219. } Position;
  220.  
  221. int currentRow = 1;
  222. int currentCol = 1;
  223. int figures = 1;
  224. int numWhite = 0, numBlack = 0;
  225. int turn = 0;
  226.  
  227. yyerror(s)
  228. char * s;
  229. { printf(" SYNTAX ERROR - The old yacc standard!\n %s");
  230.   exit(-1);
  231. }
  232.  
  233. %}
  234.  
  235. %union {
  236.        int ival;
  237.        char sval[22];
  238.        }
  239.  
  240. %token <ival> NUMBER PLUS_DASH_PLUS
  241. %token <sval> MOVE CHAR
  242.  
  243. /* grammar symbols */
  244. %token BAR DOTS DOT WHITE BLACK HANDICAP_PT
  245. %%
  246.  start:         moves
  247.                       {     printf("showpage\n");
  248.                        }
  249.  
  250. moves:        moves words
  251.      |          moves position
  252.      |          /* */ {
  253.                       }
  254.      ;
  255.  
  256. position:    PLUS_DASH_PLUS {currentRow = 1; printf("\nboard\n"); }
  257.         lines PLUS_DASH_PLUS
  258.                         { printf("(Figure %d) comment\n", figures++);
  259.                          }
  260.     ;
  261.  
  262. lines:        NUMBER  BAR points BAR NUMBER
  263.                         { currentCol = 1; currentRow++;
  264.             }
  265.                 lines
  266.      |        BAR DOTS { currentCol = 1; currentRow++;
  267.              }
  268.                 lines
  269.      |        /* empty */
  270.      ;
  271.  
  272. points:        points point
  273.       |        point
  274.       ;
  275.  
  276. point:        DOT
  277.                      {
  278.                        currentCol++;
  279.                      }
  280.       |        WHITE
  281.                      { printf("%d %d ws\n",currentCol - 10, currentRow - 10);
  282.                        currentCol++;
  283.                      }
  284.       |        BLACK
  285.                      {  printf("%d %d bs\n",currentCol - 10, currentRow - 10);
  286.                        currentCol++;
  287.                      }
  288.       |        MOVE
  289.              { printf(" (%c) %d %d label \n", $1[0], currentCol - 10, currentRow - 10);
  290.                        currentCol++;
  291.                     }
  292.       |        HANDICAP_PT
  293.                      {
  294.                        currentCol++;
  295.                       }
  296.       |         NUMBER
  297.                      { printf("(%d) %d %d ", $1, currentCol - 10, currentRow - 10);
  298.                         currentCol++;
  299.                         if (turn == 0){
  300.               turn = 1;
  301.               printf("%s\n", BLACKMOVE);
  302.             }
  303.                         else {
  304.               turn = 0;
  305.               printf("%s\n", WHITEMOVE);
  306.             }
  307.                      }
  308.       ;
  309.  
  310. words:        words CHAR
  311.                     { }
  312.      |          /* */
  313.      ;
  314.  
  315.  
  316. SHAR_EOF
  317. fi
  318. if test -f 'gopro.ps'
  319. then
  320.     echo shar: "will not over-write existing file 'gopro.ps'"
  321. else
  322. cat << \SHAR_EOF > 'gopro.ps'
  323. %!
  324. %    *************************************************
  325. %    *                        *
  326. %    *        Jan van der Steen        *
  327. %    *         jansteen@cwi.nl        *
  328. %    *            Amsterdam            *
  329. %    *         The Netherlands        *
  330. %    *                        *
  331. %    *************************************************
  332. %
  333. /corrections [
  334.  0  0  0  0  0  0  0  0  0 -5
  335.  0 -5 -5 -5 -5 -5 -5 -5 -5  0
  336.  5  0  0  0  0  0  0  0  0  0
  337.  5  0  0  0  0  0  0  0  0  0
  338.  5  0  0  0  0  0  0  0  0  0
  339.  5  0  0  0  0  0  0  0  0  0
  340.  5  0  0  0  0  0  0  0  0  0
  341.  5  0  0  0  0  0  0  0  0  0
  342.  5  0  0  0  0  0  0  0  0  0
  343.  5  0  0  0  0  0  0  0  0 -2
  344. ] def
  345.  
  346. /boardline    .01 def
  347. /border        .07 def
  348. /whiteborder    .02 def
  349. /blackrad    .48 def
  350. /whiterad    .48 def
  351. /hoshirad    .10 def
  352. /strsize    .75 def
  353.  
  354. /upi        72    def
  355. /cpi         2.54 def
  356. /initdone     0    def
  357.  
  358. /lastdx    0 def
  359. /lastdy    0 def
  360. /row    0 def
  361. /col    1 def
  362. /ibg    4 def
  363. /linelength  8.3 cpi mul def
  364. /pagelength 12   cpi mul def
  365.  
  366. /dpi {
  367.     72 0 matrix defaultmatrix dtransform
  368.     /yres exch def /xres exch def
  369.     xres dup mul yres dup mul add sqrt
  370. } def
  371. /dpu { dpi upi div } def
  372. /dpc { dpi mul cpi div } def
  373. /dpg { gridmax 2 mul diawidth exch div cvi } def
  374. /upg { dpg dpu div } def
  375.  
  376. /boardinit {
  377.     /realsize exch def
  378.     /boardsize exch def
  379.     initdone 0 eq {
  380.     /gap
  381.         realsize boardsize div ibg mul
  382.     def
  383.     /rowmax
  384.         pagelength gap 3 mul sub
  385.         realsize   gap add div cvi
  386.     def
  387.     /colmax
  388.         linelength gap 3 mul sub
  389.         realsize   gap add div cvi
  390.     def
  391.     rowmax 0 eq colmax 0 eq and {
  392.         /rowmax 1 def
  393.         /colmax 1 def
  394.     } if
  395.     /diawidth realsize dpc def
  396.     /gridmax
  397.         boardsize 1 sub 2 div
  398.     def
  399.     upg dup scale
  400.     /initdone 1 def
  401.     } if
  402. } def
  403.  
  404. /correct {
  405.     cvi
  406.     dup 100 le {
  407.     corrections exch 1 sub get
  408.     100 div
  409.     }{
  410.     pop 0
  411.     } ifelse
  412. } bind def
  413.  
  414. /transboard {
  415. lastdx neg lastdy neg translate
  416.     row rowmax lt {
  417.     /row row 1 add def
  418.     } {
  419.     col colmax lt {
  420.         /col col 1 add def
  421.         /row 1 def
  422.     } {
  423.         gsave
  424.         showpage
  425.         grestore
  426.         /row 1 def
  427.         /col 1 def
  428.     } ifelse
  429.     } ifelse
  430.     /lastdx
  431.     gridmax 2 mul 1 add ibg add col 1 sub mul
  432.     gridmax add ibg 2 mul add
  433.     def
  434.     /lastdy
  435.     gridmax 2 mul 1 add ibg add row 1 sub mul
  436.     gridmax add ibg 2 mul add
  437.     def
  438.     lastdx lastdy translate
  439. } bind def
  440.  
  441. /hoshipos {
  442.     gridmax 9 eq {
  443.     6
  444.     } {
  445.     gridmax 6 eq {
  446.         3
  447.     } {
  448.         2
  449.     } ifelse
  450.     } ifelse
  451. } bind def
  452.  
  453. /hoshipoint {
  454.     newpath
  455.     hoshirad 0 360 arc
  456.     0 setgray
  457.     fill
  458. } def
  459.  
  460. /hoshi {
  461.     0            0        hoshipoint
  462.     hoshipos        hoshipos    hoshipoint
  463.     hoshipos        hoshipos neg    hoshipoint
  464.     hoshipos neg    hoshipos    hoshipoint
  465.     hoshipos neg    hoshipos neg    hoshipoint
  466.     gridmax 9 eq {
  467.     0        hoshipos    hoshipoint
  468.     hoshipos    0        hoshipoint
  469.     0        hoshipos neg    hoshipoint
  470.     hoshipos neg    0        hoshipoint
  471.     } if
  472. } def
  473.  
  474. /board {
  475.     transboard
  476.     newpath
  477.     boardline setlinewidth
  478.     gridmax neg 1 gridmax {
  479.         gridmax neg moveto
  480.         0 gridmax gridmax neg sub rlineto
  481.     } for
  482.     gridmax neg 1 gridmax {
  483.         gridmax neg exch moveto
  484.         gridmax gridmax neg sub 0 rlineto
  485.     } for
  486.     stroke
  487.     newpath
  488.         gridmax neg    gridmax            moveto
  489.     0              gridmax 2 mul neg  rlineto
  490.     gridmax 2 mul  0                  rlineto
  491.     0              gridmax 2 mul      rlineto
  492.     closepath
  493.     border setlinewidth
  494.     stroke
  495.     hoshi
  496. } def
  497.  
  498. /ws {
  499.     newpath
  500.     neg whiterad 0 360 arc
  501.     gsave
  502.         1 setgray
  503.         fill
  504.     grestore
  505.     0 setgray
  506.     whiteborder setlinewidth
  507.     stroke
  508. } bind def
  509.  
  510. /bs {
  511.     newpath
  512.     neg blackrad 0 360 arc
  513.     0 setgray
  514.     fill
  515. } bind def
  516.  
  517. /whatsize {
  518.     stringwidth
  519.     pop
  520.     /sw exch def
  521.     sw strsize gt {
  522.     % strsize sw div
  523.     % dup scale
  524.     strsize sw div 1 scale
  525.     } if
  526. } bind def
  527.  
  528. /centerstrn {
  529.     sw 2 div neg
  530.     strsize 2 div
  531.     10 100 div sub
  532.     neg
  533.     moveto
  534.     dup
  535.     correct 0 rmoveto
  536.     show
  537. } bind def
  538.  
  539. /wst {
  540.     gsave
  541.     dup 3 -1 roll
  542.     dup 3 -1 roll
  543.     ws
  544.     exch
  545.     neg
  546.     translate
  547.     whitefont
  548.     dup
  549.     whatsize
  550.     0 setgray
  551.     centerstrn
  552.     grestore
  553. } bind def
  554.  
  555. /label {
  556.    gsave
  557.        %dup 3 -1 roll
  558.        %dup 3 -1 roll
  559.        exch
  560.        neg
  561.        translate
  562.        whitefont
  563.        dup
  564.        whatsize
  565.        0 setgray
  566.        centerstrn
  567.     grestore
  568. } bind def
  569.  
  570. /bst {
  571.     gsave
  572.     dup 3 -1 roll
  573.     dup 3 -1 roll
  574.     bs
  575.     exch
  576.     neg
  577.     translate
  578.     blackfont
  579.     dup
  580.     whatsize
  581.     1 setgray
  582.     centerstrn
  583.     grestore
  584. } bind def
  585.  
  586. /centersign {
  587.     sw 2 div neg
  588.     strsize 2 div
  589.     10 100 div
  590.     sub
  591.     neg
  592.     moveto
  593.     show
  594. } bind def
  595.  
  596. /fs {
  597.     gsave
  598.     newpath
  599.         neg
  600.         translate
  601.         0 0 whiterad 0 360 arc
  602.         1 setgray
  603.     fill
  604.     fieldfont
  605.     dup
  606.     whatsize
  607.     0 setgray
  608.     centersign
  609.     grestore
  610. } bind def
  611.  
  612. /ps {
  613.     gsave
  614.     /ycoor exch def
  615.     /xcoor exch def
  616.     /color exch def
  617.     color 0 eq {
  618.         xcoor ycoor ws
  619.     } {
  620.         xcoor ycoor bs
  621.     } ifelse
  622.     newpath
  623.         xcoor ycoor neg translate
  624.         .06 setlinewidth
  625.         color setgray
  626.         -.2 0  moveto
  627.          .2 0  lineto
  628.         0  -.2 moveto
  629.         0   .2 lineto
  630.     stroke
  631.     grestore
  632. } bind def
  633.  
  634. /ms {
  635.     gsave
  636.     /ycoor exch def
  637.     /xcoor exch def
  638.     /color exch def
  639.     color 0 eq {
  640.         xcoor ycoor ws
  641.     } {
  642.         xcoor ycoor bs
  643.     } ifelse
  644.     newpath
  645.         xcoor ycoor neg translate
  646.         .06 setlinewidth
  647.         color setgray
  648.         -.2 0 moveto
  649.          .2 0 lineto
  650.     stroke
  651.     grestore
  652. } bind def
  653.  
  654. /ts {
  655.     gsave
  656.     /ycoor exch def
  657.     /xcoor exch def
  658.     /color exch def
  659.     color 0 eq {
  660.         xcoor ycoor ws
  661.     } {
  662.         xcoor ycoor bs
  663.     } ifelse
  664.     newpath
  665.         xcoor ycoor neg translate
  666.         .04 setlinewidth
  667.         color setgray
  668.         -.2353 -.175   moveto
  669.          .2353 -.175   lineto
  670.         0        .325   moveto
  671.         -.2353 -.175   lineto
  672.         % 0        .325   moveto
  673.         % .2353  -.175   lineto
  674.     closepath
  675.     stroke
  676.     grestore
  677. } bind def
  678.  
  679. /comment {
  680.     comntfont
  681.     dup stringwidth pop 2 div neg
  682.     gridmax 2 add neg moveto show
  683. } bind def
  684.  
  685. /unresolved {
  686.     gsave
  687.     comntfont
  688.     dup stringwidth pop /width exch def
  689.     0 gridmax 3 add neg translate
  690.     width gridmax 2 mul gt {
  691.     gridmax 2 mul width div dup scale
  692.     } if
  693.     width 2 div neg 0 moveto show
  694.     grestore
  695. } bind def
  696.  
  697. /blackfont {
  698.     /Helvetica-Bold findfont strsize scalefont setfont
  699. } bind def
  700. /whitefont {
  701.     /Helvetica findfont strsize scalefont setfont
  702. } bind def
  703. /fieldfont {
  704.     /Helvetica findfont strsize scalefont setfont
  705. } bind def
  706. /comntfont {
  707.     /Times-Italic findfont strsize scalefont setfont
  708. } bind def
  709. %%EndProlog
  710.  
  711. 19 6.80 boardinit
  712. SHAR_EOF
  713. fi
  714. if test -f 'input.l'
  715. then
  716.     echo shar: "will not over-write existing file 'input.l'"
  717. else
  718. cat << \SHAR_EOF > 'input.l'
  719.  
  720. %{
  721. #include "y.tab.h"
  722. #define STACKLIM 100
  723.  
  724. extern FILE *infp, *outfp;
  725. extern char *strsave();
  726.  
  727. static char istack[ STACKLIM ];
  728. static int isp = 0;
  729.  
  730. %}
  731.  
  732.  
  733. %start          IN_BOARD
  734.  
  735.  
  736. %%
  737.  
  738. <INITIAL>"  +""-"*"+"            {BEGIN IN_BOARD;
  739.                                          yylval.ival = strlen(yytext);
  740.                                          return(PLUS_DASH_PLUS);
  741.                                         }
  742. <INITIAL>"--- Branching to new variation."     /* skip */;
  743. <INITIAL>"--- Backing up"               /* skip */;
  744. <INITIAL>"a b c "([d-t][\n ])*          {yylval.sval[0] = '\n';
  745.                                          return(CHAR);}
  746. <INITIAL>.                       {yylval.sval[0] = yytext[0];
  747.                                          return(CHAR);}
  748. <IN_BOARD>"..."                return(DOTS);
  749. <IN_BOARD>"."                return(DOT);
  750. <IN_BOARD>"O"                return(WHITE);
  751. <IN_BOARD>"@"                return(BLACK);
  752. <IN_BOARD>"+"                return(HANDICAP_PT);
  753. <IN_BOARD>[A-Za-z]                      {yylval.sval[0] = yytext[0];
  754.                                          return(MOVE);}
  755. <IN_BOARD>[\n\t ]                        ;
  756. <IN_BOARD>"|"                return(BAR);
  757. <IN_BOARD>[0-9]+                    {
  758.                     sscanf(yytext, "%d", &yylval.ival);
  759.                     return(NUMBER);
  760.                     }
  761. <IN_BOARD>"  +""-"*"+"            {BEGIN INITIAL;    return(PLUS_DASH_PLUS);}
  762. <IN_BOARD>.                        /* skip */           ;
  763.  
  764.  
  765. SHAR_EOF
  766. fi
  767. if test -f 'main.c'
  768. then
  769.     echo shar: "will not over-write existing file 'main.c'"
  770. else
  771. cat << \SHAR_EOF > 'main.c'
  772. #include <stdio.h>
  773.  
  774. FILE *infp, *outfp;
  775. char *strsave();
  776. extern int yydebug;
  777.  
  778. main()
  779. {
  780.     infp = stdin;
  781.     yydebug = 0;
  782.     yyparse();
  783. }
  784. SHAR_EOF
  785. fi
  786. if test -f 'printps'
  787. then
  788.     echo shar: "will not over-write existing file 'printps'"
  789. else
  790. cat << \SHAR_EOF > 'printps'
  791. goParse < $1  > x.ps
  792. cat gopro.ps x.ps > out.ps
  793. lpr out.ps
  794. rm out.ps
  795. SHAR_EOF
  796. chmod +x 'printps'
  797. fi
  798. if test -f 'sample.input'
  799. then
  800.     echo shar: "will not over-write existing file 'sample.input'"
  801. else
  802. cat << \SHAR_EOF > 'sample.input'
  803. Ok.  I've tried it under 4.3 BSD and Dynix 3.0.17.9.
  804.  
  805. BSD doesn't have any version numbers on Yacc or Lex.
  806.  
  807. Dynix says yacc is 1.5, lex, 1.4
  808.  
  809. Here's my test file:
  810.  
  811.  
  812.  
  813.     A B C D E F G H J K L M N O P Q R S T
  814.    +-------------------------------------+
  815.  19|. . . O . . . . . . . . . . . . . . .|19
  816.  18|. O . O . . . . . . . . . . . . . . .|18
  817.  17|. . C O . . . . @ . . . . . . . . . .|17
  818.  16|O O B O @ . . @ O @ . . . . . . . . .|16
  819.  15|O . A . . . . . @ . . O . . . . . . .|15
  820.  14|O O O . . . . . . . . . . . . . . . .|14
  821.  13|. . . . @ . . . . . . . . . . . . . .|13
  822.  12|. . . . . . . . O . . O . . . . . . .|12
  823.  11|. . . . @ 1 @ . . . . . . . . . . . .|11
  824.  10|. . . + . . . . . + . . . . . + . . .|10
  825.   9|. . . . . . . 2 . 3 . . . . . . . . .| 9
  826.   8|. . . . . . . . . . . . . . . . . . .| 8
  827.   7|. . . . . . . . . . . . . . . . . . .| 7
  828.   6|. . . . . . . . . . . . . . . . . . .| 6
  829.   5|. . . . . . . . . . . . . . . . . . .| 5
  830.   4|. . . + . . . . . + . . . . . + . . .| 4
  831.   3|. . . . . . . . . . . . . . . . . . .| 3
  832.   2|. . . . . . . . . . . . . . . . . . .| 2
  833.   1|. . . . . . . . . . . . . . . . . . .| 1
  834.    +-------------------------------------+    Commands:q><.,ebcx][gnpui
  835.     A B C D E F G H J K L M N O P Q R S T     @: 0     O: 0
  836.  White #22 at 'M15'
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.     A B C D E F G H J K L M N O P Q R S T
  844.    +-------------------------------------+
  845.  19|. . . . . . . . . . . . . . . . . . .|19
  846.  18|. . . . . . . . . . . . . . . . . . .|18
  847.  17|. . . . . . . . . . . . . . . . . . .|17
  848.  16|. . . @ @ @ @ @ @ @ @ @ @ @ @ @ . . .|16
  849.  15|. . . O O O O O O O O O . . . . . . .|15
  850.  14|. . . . . . . . . . . . . . . . . . .|14
  851.  13|. . . . . . . . . . . . . . . . . . .|13
  852.  12|. . . . . . . . . . . . . . . . . . .|12
  853.  11|. . . . . . . . . . . . . . . . . . .|11
  854.  10|. . . + . . . . . + . . . . . + . . .|10
  855.   9|. . . . . . . . . . . . . . . . . . .| 9
  856.   8|. . . . . . . . . . . . . . . . . . .| 8
  857.   7|. . . . . . . . . . . . . . . . . . .| 7
  858.   6|. . . . . . . . . . . . . . . . . . .| 6
  859.   5|. . . . . . . . . . . . . . . . . . .| 5
  860.   4|. . . + . . . . . + . . . . . + . . .| 4
  861.   3|. . . . . . . . . . . . . . . . . . .| 3
  862.   2|. . . . . . . . . . . . . . . . . . .| 2
  863.   1|. . . . . . . . . . . . . . . . . . .| 1
  864.    +-------------------------------------+    Commands:q><.,ebcx][gnpui
  865.     A B C D E F G H J K L M N O P Q R S T     @: 0     O: 0
  866.  White #22 at 'M15'
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873. SHAR_EOF
  874. fi
  875. exit 0
  876. #    End of shell archive
  877.